import 'package:helloword/retrofit/user_entity.dart';

userEntityFromJson(UserEntity data, Map<String, dynamic> json) {
	if (json['dataType'] != null) {
		data.dataType = json['dataType'].toString();
	}
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['type'] != null) {
		data.type = json['type'].toString();
	}
	if (json['text'] != null) {
		data.text = json['text'].toString();
	}
	if (json['subTitle'] != null) {
		data.subTitle = json['subTitle'];
	}
	if (json['actionUrl'] != null) {
		data.actionUrl = json['actionUrl'].toString();
	}
	if (json['adTrack'] != null) {
		data.adTrack = json['adTrack'];
	}
	if (json['follow'] != null) {
		data.follow = json['follow'];
	}
	return data;
}

Map<String, dynamic> userEntityToJson(UserEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['dataType'] = entity.dataType;
	data['id'] = entity.id;
	data['type'] = entity.type;
	data['text'] = entity.text;
	data['subTitle'] = entity.subTitle;
	data['actionUrl'] = entity.actionUrl;
	data['adTrack'] = entity.adTrack;
	data['follow'] = entity.follow;
	return data;
}